﻿
using System;
using System.IO;
using System.Web;
using AnyOffice.Components;
using AnyOffice.DAL;
using AnyOffice.Web;
namespace AnyOffice.general.file_folder
{
    public partial class read : ModulePage
    {
        public string _filename = string.Empty;
        public bool isppt;
        public bool isword;
        public bool isexcel;
        public string url = string.Empty;
        public string fileType = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            string s = (Request.QueryString["filename"] != null) ? Request.QueryString["filename"].ToString() : "";


            this.url = "/readdisk.aspx?filename=" + Server.UrlEncode(s);
            s = s.Replace("../", "");
            string str2 = "/attachment/file_folder/" + HttpContext.Current.User.Identity.Name;
            FileInfo info = new FileInfo(Server.MapPath(str2 + s));
            this._filename = info.Name;
            if (this._filename.ToLower().EndsWith(".ppt") || this._filename.ToLower().EndsWith(".pptx"))
            {
                this.isppt = true;
                fileType = "ppt";
            }

            if (this._filename.ToLower().EndsWith(".doc") || this._filename.ToLower().EndsWith(".docx"))
            {
                this.isword = true;
                fileType = "doc";

            }

            if (this._filename.ToLower().EndsWith(".xls") || this._filename.ToLower().EndsWith(".xlsx"))
            {
                this.isexcel = true;
                fileType = "xls";

            }








        }
    }
}
